﻿using Newtonsoft.Json;
using RestSharp;
using Ymatou.ServiceCenter;

namespace Ymatou.Evaluate.Service.Buyer.Extensions
{
    [Resource("exp.iapi.ymatou.com", "api/addUserExp", Method.POST, ParameterBuildType.Json)]
    public class UserExpRequest
    {
        [JsonProperty("userId")]
        public int UserId { get; set; }

        [JsonProperty("bizCode")]
        public int BizCode { get; set; }

        [JsonProperty("bizNo")]
        public string BizNo { get; set; }

        [JsonProperty("parameters")]
        public ExtParam ExtParams { get; set; }
    }

    public class ExtParam
    {
        [JsonProperty("isContainImageText")]
        public string HasImgText { get; set; }

        [JsonProperty("totalPrice")]
        public string TotalPrice { get; set; }

        [JsonProperty("isSubmit")]
        public string IsSubmit { get; set; }
    }

    public class UserExpResponse
    {
        [JsonProperty("errorMessage")]
        public string ErrorMessage { get; set; }

        [JsonProperty("errorCode")]
        public int ErrorCode { get; set; }

        [JsonProperty("success")]
        public bool Success { get; set; }

        [JsonProperty("result")]
        public UserExpResult Result { get; set; }
    }

    public class UserExpResult
    {
        [JsonProperty("exp")]
        public int UserExp { get; set; }
    }
}